202408121102 git不同仓库设置不同的用户名和邮箱
设置全局用户名和邮箱
git config --global user.name "username"
git config --global user.email "username@email.com"
设置当前仓库的用户名和邮箱(终端切换到仓库目录)
git config user.name "username"
git config user.email "username@email.com"
查看当前仓库的用户名和邮箱(终端切换到仓库目录)
git config user.name
git config user.email
手动设置/查看当前仓库的用户名和邮箱
- 打开仓库下的
.git/config
文件 - 配置信息
[user]
name = username
email = username@email.com